<form name="uploadForm" ng-init="dvm.init()" ng-submit="dvm.insert(uploadForm.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.cancel()">&times;</button>
    <h4 class="modal-title">图片</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <div class="alert alert-warning" style="margin-bottom:0">
        <span>本地图片仅支持 JPG、GIF、PNG 格式，并且文件小于 2MB。网络图片地址以 http://、https:// 或 ftp:// 格式开头！</span>
      </div>
    </div>
    <div class="form-group">
      <p class="form-control-static">请填入网络图片地址或点击按钮上传本地图片到服务器.</p>
    </div>
    <div class="form-group">
      <div class="input-group col-sm-12">
        <input type="text" name="url" class="form-control" ng-model="dvm.url" required autofocus
            placeholder="http://example.com/image.jpg">
        <span class="input-group-btn">
          <button type="button" class="btn btn-default" ngf-select="dvm.upload($file)" ngf-max-size="'2MB'"
              ngf-accept="'image/jpeg,image/png,image/gif'"><i class="fa fa-upload"></i></button>
        </span>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button type="submit" class="btn btn-default" ng-disabled="uploadForm.$invalid">
      <i class="fa fa-check"></i> 确定</button>
    <button type="button" class="btn btn-default" ng-click="dvm.cancel()">
      <i class="fa fa-times"></i> 取消</button>
  </div>
</form>
